package br.gov.mi.corporativo.dominio.boundary.rhmi.cargocomissionado;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import br.gov.mi.corporativo.dominio.entidade.rhmi.CargoComissionado;


@Path("cargoscomissionados")
public class CargoComissionadoRestAdapter extends SpringBeanAutowiringSupport {


	@Autowired
	private CargoComissionadoEndPoint service;
	
	@GET
	@Produces({MediaType.APPLICATION_JSON})
	public List<CargoComissionado> recuperarTodos(){
		return service.recuperarTodos();
	}
	
	
	@GET
	@Path("/id/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public CargoComissionado recuperarPorId(@PathParam("id")Long id){
		return service.recuperarPorId(id);
	}

	@Path("/nome/{nome}")
	@Produces({MediaType.APPLICATION_JSON})
	public List<CargoComissionado> recuperarPorNome(@PathParam("nome")String nome){
		return service.recuperarPorDescricao(nome);
	}
	
	@Path("/ativo/{ativo}")
	@Produces({MediaType.APPLICATION_JSON})
	public List<CargoComissionado> recuperarPorAtivo(@PathParam("ativo")String ativo){
		return service.recuperarPorAtivo(ativo);
	}
	
	
}
